#include <vector>
#include <iostream>
#include <algorithm>

using namespace std;

int nonConstructibleChange(vector<int> v) {
  // 把答案写在这里
  sort(v.begin(), v.end());

  int currentMaxChange = 0;

  for (auto begin = v.begin(); begin != v.end(); ++begin) {
    if (*begin > currentMaxChange + 1) {
      return currentMaxChange + 1;
    }
    else {
      currentMaxChange += *begin;
    }
  }

  return currentMaxChange + 1;
}

int main(int argc, char const *argv[])
{
  vector<int> wallet {1, 5, 10, 20, 50, 100};
  cout<<nonConstructibleChange(wallet)<<endl;
  return 0;
}

